3.1.25 \(\int \frac {c-c \sec (e+f x)}{(a+a \sec (e+f x))^2} \, dx\) [25]

Optimal. Leaf size=61 \[ \frac {c x}{a^2}-\frac {2 c \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))^2}-\frac {5 c \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))} \]

[Out]

c*x/a^2-2/3*c*tan(f*x+e)/a^2/f/(1+sec(f*x+e))^2-5/3*c*tan(f*x+e)/a^2/f/(1+sec(f*x+e))

________________________________________________________________________________________

Rubi [A]
time = 0.11, antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.208, Rules used = {3988, 3862, 4004, 3879, 3881} \begin {gather*} -\frac {5 c \tan (e+f x)}{3 a^2 f (\sec (e+f x)+1)}-\frac {2 c \tan (e+f x)}{3 a^2 f (\sec (e+f x)+1)^2}+\frac {c x}{a^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c - c*Sec[e + f*x])/(a + a*Sec[e + f*x])^2,x]

[Out]

(c*x)/a^2 - (2*c*Tan[e + f*x])/(3*a^2*f*(1 + Sec[e + f*x])^2) - (5*c*Tan[e + f*x])/(3*a^2*f*(1 + Sec[e + f*x])
)

Rule 3862

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Simp[(-Cot[c + d*x])*((a + b*Csc[c + d*x])^n/(d*
(2*n + 1))), x] + Dist[1/(a^2*(2*n + 1)), Int[(a + b*Csc[c + d*x])^(n + 1)*(a*(2*n + 1) - b*(n + 1)*Csc[c + d*
x]), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0] && LeQ[n, -1] && IntegerQ[2*n]

Rule 3879

Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[-Cot[e + f*x]/(f*(b + a*
Csc[e + f*x])), x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0]

Rule 3881

Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), x_Symbol] :> Simp[b*Cot[e + f*x]*((a
+ b*Csc[e + f*x])^m/(a*f*(2*m + 1))), x] + Dist[(m + 1)/(a*(2*m + 1)), Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^(
m + 1), x], x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0] && LtQ[m, -2^(-1)] && IntegerQ[2*m]

Rule 3988

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_), x_Symbol] :> Dis
t[c^n, Int[ExpandTrig[(1 + (d/c)*csc[e + f*x])^n, (a + b*csc[e + f*x])^m, x], x], x] /; FreeQ[{a, b, c, d, e,
f, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IGtQ[m, 0] && ILtQ[n, 0] && LtQ[m + n, 2]

Rule 4004

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[c*(x/a),
x] - Dist[(b*c - a*d)/a, Int[Csc[e + f*x]/(a + b*Csc[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[
b*c - a*d, 0]

Rubi steps

\begin {align*} \int \frac {c-c \sec (e+f x)}{(a+a \sec (e+f x))^2} \, dx &=\frac {\int \left (\frac {c}{(1+\sec (e+f x))^2}-\frac {c \sec (e+f x)}{(1+\sec (e+f x))^2}\right ) \, dx}{a^2}\\ &=\frac {c \int \frac {1}{(1+\sec (e+f x))^2} \, dx}{a^2}-\frac {c \int \frac {\sec (e+f x)}{(1+\sec (e+f x))^2} \, dx}{a^2}\\ &=-\frac {2 c \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))^2}-\frac {c \int \frac {-3+\sec (e+f x)}{1+\sec (e+f x)} \, dx}{3 a^2}-\frac {c \int \frac {\sec (e+f x)}{1+\sec (e+f x)} \, dx}{3 a^2}\\ &=\frac {c x}{a^2}-\frac {2 c \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))^2}-\frac {c \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))}-\frac {(4 c) \int \frac {\sec (e+f x)}{1+\sec (e+f x)} \, dx}{3 a^2}\\ &=\frac {c x}{a^2}-\frac {2 c \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))^2}-\frac {5 c \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.34, size = 113, normalized size = 1.85 \begin {gather*} \frac {c \sec \left (\frac {e}{2}\right ) \sec ^3\left (\frac {1}{2} (e+f x)\right ) \left (9 f x \cos \left (\frac {f x}{2}\right )+9 f x \cos \left (e+\frac {f x}{2}\right )+3 f x \cos \left (e+\frac {3 f x}{2}\right )+3 f x \cos \left (2 e+\frac {3 f x}{2}\right )-24 \sin \left (\frac {f x}{2}\right )+18 \sin \left (e+\frac {f x}{2}\right )-14 \sin \left (e+\frac {3 f x}{2}\right )\right )}{24 a^2 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c - c*Sec[e + f*x])/(a + a*Sec[e + f*x])^2,x]

[Out]

(c*Sec[e/2]*Sec[(e + f*x)/2]^3*(9*f*x*Cos[(f*x)/2] + 9*f*x*Cos[e + (f*x)/2] + 3*f*x*Cos[e + (3*f*x)/2] + 3*f*x
*Cos[2*e + (3*f*x)/2] - 24*Sin[(f*x)/2] + 18*Sin[e + (f*x)/2] - 14*Sin[e + (3*f*x)/2]))/(24*a^2*f)

________________________________________________________________________________________

Maple [A]
time = 0.11, size = 46, normalized size = 0.75

method result size
derivativedivides \(\frac {c \left (\frac {\left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3}-2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )\right )}{f \,a^{2}}\) \(46\)
default \(\frac {c \left (\frac {\left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3}-2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )\right )}{f \,a^{2}}\) \(46\)
norman \(\frac {\frac {c x}{a}-\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{a f}+\frac {c \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 a f}}{a}\) \(50\)
risch \(\frac {c x}{a^{2}}-\frac {2 i c \left (9 \,{\mathrm e}^{2 i \left (f x +e \right )}+12 \,{\mathrm e}^{i \left (f x +e \right )}+7\right )}{3 f \,a^{2} \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )^{3}}\) \(55\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c-c*sec(f*x+e))/(a+a*sec(f*x+e))^2,x,method=_RETURNVERBOSE)

[Out]

1/f*c/a^2*(1/3*tan(1/2*f*x+1/2*e)^3-2*tan(1/2*f*x+1/2*e)+2*arctan(tan(1/2*f*x+1/2*e)))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 129 vs. \(2 (61) = 122\).
time = 0.50, size = 129, normalized size = 2.11 \begin {gather*} -\frac {c {\left (\frac {\frac {9 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac {\sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}}{a^{2}} - \frac {12 \, \arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{a^{2}}\right )} + \frac {c {\left (\frac {3 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac {\sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}\right )}}{a^{2}}}{6 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c-c*sec(f*x+e))/(a+a*sec(f*x+e))^2,x, algorithm="maxima")

[Out]

-1/6*(c*((9*sin(f*x + e)/(cos(f*x + e) + 1) - sin(f*x + e)^3/(cos(f*x + e) + 1)^3)/a^2 - 12*arctan(sin(f*x + e
)/(cos(f*x + e) + 1))/a^2) + c*(3*sin(f*x + e)/(cos(f*x + e) + 1) - sin(f*x + e)^3/(cos(f*x + e) + 1)^3)/a^2)/
f

________________________________________________________________________________________

Fricas [A]
time = 3.32, size = 92, normalized size = 1.51 \begin {gather*} \frac {3 \, c f x \cos \left (f x + e\right )^{2} + 6 \, c f x \cos \left (f x + e\right ) + 3 \, c f x - {\left (7 \, c \cos \left (f x + e\right ) + 5 \, c\right )} \sin \left (f x + e\right )}{3 \, {\left (a^{2} f \cos \left (f x + e\right )^{2} + 2 \, a^{2} f \cos \left (f x + e\right ) + a^{2} f\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c-c*sec(f*x+e))/(a+a*sec(f*x+e))^2,x, algorithm="fricas")

[Out]

1/3*(3*c*f*x*cos(f*x + e)^2 + 6*c*f*x*cos(f*x + e) + 3*c*f*x - (7*c*cos(f*x + e) + 5*c)*sin(f*x + e))/(a^2*f*c
os(f*x + e)^2 + 2*a^2*f*cos(f*x + e) + a^2*f)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {c \left (\int \frac {\sec {\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\, dx + \int \left (- \frac {1}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\right )\, dx\right )}{a^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c-c*sec(f*x+e))/(a+a*sec(f*x+e))**2,x)

[Out]

-c*(Integral(sec(e + f*x)/(sec(e + f*x)**2 + 2*sec(e + f*x) + 1), x) + Integral(-1/(sec(e + f*x)**2 + 2*sec(e
+ f*x) + 1), x))/a**2

________________________________________________________________________________________

Giac [A]
time = 0.49, size = 53, normalized size = 0.87 \begin {gather*} \frac {\frac {3 \, {\left (f x + e\right )} c}{a^{2}} + \frac {a^{4} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 6 \, a^{4} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{a^{6}}}{3 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c-c*sec(f*x+e))/(a+a*sec(f*x+e))^2,x, algorithm="giac")

[Out]

1/3*(3*(f*x + e)*c/a^2 + (a^4*c*tan(1/2*f*x + 1/2*e)^3 - 6*a^4*c*tan(1/2*f*x + 1/2*e))/a^6)/f

________________________________________________________________________________________

Mupad [B]
time = 1.34, size = 41, normalized size = 0.67 \begin {gather*} \frac {c\,x}{a^2}-\frac {c\,\left (6\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )-{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3\right )}{3\,a^2\,f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c - c/cos(e + f*x))/(a + a/cos(e + f*x))^2,x)

[Out]

(c*x)/a^2 - (c*(6*tan(e/2 + (f*x)/2) - tan(e/2 + (f*x)/2)^3))/(3*a^2*f)

________________________________________________________________________________________